package com.adteam.xmap.manager.impl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.adteam.xmap.manager.ProcessManager;

public class ProcessManagerImpl extends HibernateDaoSupport implements ProcessManager {

	public void addProcess(Process process) {

		getHibernateTemplate().save(process);
	}

	public void delProcess(int id) {
		
		getHibernateTemplate().delete(findProcessById(id));
	}

	public List findAllProcesses() {

		return getHibernateTemplate().find("select p from Picture p");
	}

	public Process findProcessById(int id) {

		return (Process)getHibernateTemplate().load(Process.class, id);
	}

	public void updateProcess(Process process) {

		getHibernateTemplate().update(process);
	}

}
